package com.pth.admin.action;

import com.opensymphony.xwork2.ActionSupport;
import com.pth.model.Jianjie;
import com.pth.service.JianjieService;
import com.pth.utils.timeUtil;

@SuppressWarnings("serial")
public class JianjieAllAction extends ActionSupport {

	
	private  int id;
	private Jianjie jianjie;
	private  JianjieService jianjieService;
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public JianjieService getJianjieService() {
		return jianjieService;
	}
	public void setJianjieService(JianjieService jianjieService) {
		this.jianjieService = jianjieService;
	}
	
	public String delete() throws Exception{
		
		Jianjie jianjie=jianjieService.getJianjieByid(id);
		jianjieService.delete(jianjie);
		
		return "delete";
		
	}
	
	public String update() throws Exception{
		
		jianjie.setPublishtime(timeUtil.getCurrentDate());
		//jianjie.setScannum(jianjieService.getJianjieByid(jianjie.getId()).getScannum());
		jianjieService.modify(jianjie);
		
		return "update";
	}
	
	public void setJianjie(Jianjie jianjie) {
		this.jianjie = jianjie;
	}
	public Jianjie getJianjie() {
		return jianjie;
	}
}
